package org.kia.data;

import java.util.List;

import org.kia.data.DataProxy.MethodType;
import org.kia.data.model.CategoryModel;
import org.kia.data.model.ItemModel;

import com.google.gson.Gson;

/**
 * Mock server data
 * 
 * @author Amir Lazarovich
 */
public class Mocker {

	/**
	 * Mock categories
	 * 
	 * @return
	 */
	public static List<CategoryModel> getCategories() {
		String json = "[" +
			"{" +
				"'id': '1'," +
				"'name': 'category 1'," +
				"'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'" +
			"}," +
			"{" +
				"'id': '2'," +
				"'name': 'category 2'," +
				"'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'" +
			"}," +
			"{" +
				"'id': '3'," +
				"'name': 'category 3'," +
				"'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'" +
			"}," +
			"{" +
				"'id': '4'," +
				"'name': 'category 4'," +
				"'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'" +
			"}" +
		"]";
		
		Gson gson = new Gson();
        return gson.fromJson(json, MethodType.CATEGORIES.getType());
	}
	
	
	/**
	 * Mock Items in Category
	 * 
	 * @return
	 */
	public static List<ItemModel> getItemsInCategory() {
		String json = "[" +
			"{" +
				"'id': '1'," +
			    "'name': 'item 1'," +
			    "'address': 'address 1'," +
			    "'phone': 'phone 1'," +
			    "'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'," +
			    "'lat': 32.5," +
			    "'long': 32.3," +
			    "'distance': 10," +
			    "'parameters': [" +
			    	"{" +
		            "'name':'Elevator'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'true'" +
			        "}," +
			    	"{" +
		            "'name':'Ramp'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'false'" +
			        "}" +
			    "]," +
			    "'parking': true," +
			    "'entrance': true," +
			    "'elevator': true" +
			"}," +
			"{" +
				"'id': '2'," +
			    "'name': 'item 2'," +
			    "'address': 'address 2'," +
			    "'phone': 'phone 2'," +
			    "'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'," +
			    "'lat': 32.5," +
			    "'long': 32.3," +
			    "'distance': 10," +
			    "'parameters': [" +
			    	"{" +
		            "'name':'Elevator'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'true'" +
			        "}," +
			    	"{" +
		            "'name':'Ramp'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'false'" +
			        "}" +
			    "]," +
			    "'parking': true," +
			    "'entrance': true," +
			    "'elevator': true" +
			"}" +
		"]";
		
		Gson gson = new Gson();
        return gson.fromJson(json, MethodType.ITEMS_IN_CATEGORY.getType());
	}
	
	/**
	 * Mock Item
	 * 
	 * @return
	 */
	public static ItemModel getItem() {
		String json = "" +
			"{" +
			    "'id': '00caa9cbfc9ed29b78375f52326039108589d08f'," +
			    "'name': 'item 1'," +
			    "'address': 'address 1'," +
			    "'phone': 'phone 1'," +
			    "'image': 'http://www.rent.com/media/property/523/144/52314444.jpg'," +
			    "'lat': 32.5," +
			    "'long': 32.3," +
			    "'distance': 10," +
			    "'parameters': [" +
			    	"{" +
		            "'name':'Elevator'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'true'" +
			        "}," +
			    	"{" +
		            "'name':'Ramp'," +
		            "'image':'http://www.rent.com/media/property/523/144/52314444.jpg'," +
		            "'available':'false'" +
			        "}" +
			    "]," +
			    "'parking': true," +
			    "'entrance': true," +
			    "'elevator': true" +
			"}";
		
		Gson gson = new Gson();
        return gson.fromJson(json, MethodType.ITEM.getType());
	}
}
